/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "contrib_sind_patronal_cab")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ContribSindPatronalCab.findAll", query = "SELECT c FROM ContribSindPatronalCab c")})
public class ContribSindPatronalCab implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    @Column(name = "VIGENCIA_ANO", length = 4)
    private String vigenciaAno;
    @JoinColumn(name = "ID_SINDICATO", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private Sindicato idSindicato;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idContribSindPatronalCab")
    private List<ContribSindPatronalDet> contribSindPatronalDetList;

    public ContribSindPatronalCab() {
    }

    public ContribSindPatronalCab(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getVigenciaAno() {
        return vigenciaAno;
    }

    public void setVigenciaAno(String vigenciaAno) {
        this.vigenciaAno = vigenciaAno;
    }

    public Sindicato getIdSindicato() {
        return idSindicato;
    }

    public void setIdSindicato(Sindicato idSindicato) {
        this.idSindicato = idSindicato;
    }

    @XmlTransient
    public List<ContribSindPatronalDet> getContribSindPatronalDetList() {
        return contribSindPatronalDetList;
    }

    public void setContribSindPatronalDetList(List<ContribSindPatronalDet> contribSindPatronalDetList) {
        this.contribSindPatronalDetList = contribSindPatronalDetList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ContribSindPatronalCab)) {
            return false;
        }
        ContribSindPatronalCab other = (ContribSindPatronalCab) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.ContribSindPatronalCab[ id=" + id + " ]";
    }
    
}
